<template>
  <div class="tpl-content-wrapper">
    正在打开项目.....
  </div>
</template>

<script>
  import * as apis from '../../../apis'
  export default {
    data() {
      return {
        id: this.$route.params.id || ''
      }
    },
    created() {
      if (this.id) {
        this.getProject()
      }
    },
    methods: {
      getProject() {
        apis.getProject(this.id).then(({data}) => {
           if (data.result_code == 1) {
            if (data.result.type == '1'){
              this.$router.push({ name: 'ProjectZc', params: {id: this.id}})
            } else {
              this.$router.push({ name: 'ProjectCq', params: {id: this.id}})
            }
          }     
        })
      }
    }
  }

</script>
